//
//  UIView+Configure.h
//  ZhouDao
//
//  Created by zengweihuan on 2018/5/24.
//  Copyright © 2018年 hyj. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Masonry/Masonry.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^MASConstraintBlock)(MASConstraintMaker *make);


@interface UIView (Configure)
+(instancetype)configureViewWithFrame:(CGRect)frame backgroundColor:(UIColor* _Nullable)backgroundColor inView:(UIView* _Nullable)inView;
+(instancetype)configureViewWithBackgroundColor:(UIColor* _Nullable)backgroundColor inView:(UIView* _Nullable)inView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock;
@end

@interface UILabel (Configure)
+(instancetype)configureLabelWithFrame:(CGRect)frame  font:(CGFloat)font textColor:(UIColor* _Nullable)textColor inView:(UIView* _Nullable)aView;
+(instancetype)configureLabelWithFont:(CGFloat)font textColor:(UIColor* _Nullable)textColor inView:(UIView* _Nullable)aView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock;
+(instancetype)configureLabelWithFontStyle:(UIFont * _Nullable)font textColor:(UIColor* _Nullable)textColor inView:(UIView* _Nullable)aView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock;
@end

@interface UIImageView (Configure)
+(instancetype)configureIvWithOrigin:(CGPoint)origin image:(NSString* _Nullable)image inView:(UIView* _Nullable)inView;
+(instancetype)configureIvWithImage:(NSString* _Nullable)image inView:(UIView* _Nullable)inView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock;
+(instancetype)configureIvWithFrame:(CGRect)frame inView:(UIView* _Nullable)aView;
+(instancetype)configureIvWithView:(UIView* _Nullable)aView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock;
@end

@interface UIButton (Configure)

+(instancetype)configureBtnWithFrame:(CGRect)frame title:(NSString* _Nullable)title titleColor:(UIColor*)titleColor image:(NSString* _Nullable)image font:(CGFloat)font inView:(UIView* _Nullable)aView;
+(instancetype)configureBtnWithTitle:(NSString* _Nullable)title titleColor:(UIColor* _Nullable)titleColor image:(NSString* _Nullable)image font:(CGFloat)font inView:(UIView* _Nullable)aView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock;

@end

@interface UITextField (Configure)
+(instancetype)configureTextFieldWithFrame:(CGRect)frame font:(CGFloat)font textColor:(UIColor * _Nullable)textColor text:(NSString* _Nullable)text placeholder:(NSString* _Nullable)placeholder maxLength:(NSInteger)length inView:(UIView* _Nullable)aView  textChange:(void (^)(NSString* text))textChange;
+(instancetype)configureTextFieldWithFont:(CGFloat)font textColor:(UIColor * _Nullable)textColor text:(NSString* _Nullable)text placeholder:(NSString* _Nullable)placeholder maxLength:(NSInteger)length inView:(UIView* _Nullable)aView MASConstraintMaker:(MASConstraintBlock)masConstraintBlock  textChange:(void (^)(NSString* text))textChange;
@end

NS_ASSUME_NONNULL_END
